<template>
  <div>
    <button type="button" @click="getData">获取数据</button>
    <div v-for="(item,index) in list" :key="index">
        {{item.a}}
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: []
    };
  },
  mounted(){
      this.getData()
  },
  methods: {
    async getData() {
      let params = {};
      const res = await this.$http.post("/getIncomeList", params);
      //请求成功后将值赋给list
      this.list=[{a:1},{a:2}]
    }

  }
};
</script>

<style>
</style>